package com.unknow.first.dapp.admin.account.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lianziyou.chain.common.api.CommonResult;
import com.unknow.first.dapp.admin.account.constants.AccountConstants;
import com.unknow.first.dapp.admin.account.mapper.AddressWithdraw;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
public interface AddressWithdrawService extends IService<AddressWithdraw>{


    int insertSelective(AddressWithdraw record);

    int updateByPrimaryKeySelective(AddressWithdraw record);

    int updateBatch(List<AddressWithdraw> list);

    int batchInsert(List<AddressWithdraw> list);

    /**
     * 用户发起提现
     * @param address
     * @param coinId
     * @param amount
     * @return
     */
    CommonResult<AddressWithdraw> withdraw(String address, String toAddress, Integer coinId, BigDecimal amount) throws Exception;

    /**
     * 管理员审核提现订单
     * @param id
     * @param withdrawStatus
     * @param remark
     * @return
     */
    CommonResult<?> adminAudit(Long id, AccountConstants.WithdrawStatus withdrawStatus, String remark) throws Exception;

    /**
     * 处理提现状态完成
     */
    void processWithdrawStatusDone();

    /**
     * 处理提现状态完成（备用逻辑）
     */
    void processWithdrawStatusDoneBack() throws IOException;

}
